package cn.wolfcode._04_anno;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
@Scope("prototype")
public class MyDataSource {

    public MyDataSource(){
        System.out.println("对象创建。。。");
    }

    public void getConnetion(){
        System.out.println("连接。。。");
    }

    @PostConstruct
    public void init(){
        System.out.println("初始化。。。");
    }

    @PreDestroy
    public void close(){
        System.out.println("销毁。。。");
    }
}
